package com.suxin.spring.configuration;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.convert.ConversionService;

/**
 * @author Tang
 * @classname ConversionServiceDeducer
 * @description [  ]
 * @date 2023/3/21 15:35
 */
public class ConversionServiceDeducer {

    private ApplicationContext applicationContext;

    public ConversionServiceDeducer(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    public ConversionService getConversionService() {
        return this.applicationContext.getBean(
                ConfigurableApplicationContext.CONVERSION_SERVICE_BEAN_NAME,ConversionService.class)
                ;
    }
}
